
public class TestMail{
      //https://my.oschina.net/dsm/blog/72763
public static void main(String[] args){
         //这个类主要是设置邮件
      MultiMailSenderInfo mailInfo = new MultiMailSenderInfo(); 
      mailInfo.setMailServerHost("smtp.163.com"); 
      mailInfo.setMailServerPort("25"); 
      mailInfo.setValidate(true); 
      mailInfo.setUserName("xxx@163.com"); 
      mailInfo.setPassword("**********");//您的邮箱密码 
      mailInfo.setFromAddress("xxx@163.com"); 
      mailInfo.setToAddress("xxx@163.com"); 
      mailInfo.setSubject("设置邮箱标题"); 
      mailInfo.setContent("设置邮箱内容");
      String[] receivers = new String[]{"***@163.com", "***@tom.com"}; 
      String[] ccs = receivers; mailInfo.setReceivers(receivers); 
      mailInfo.setCcs(ccs); 
      //这个类主要来发送邮件 
      MultiMailsender sms = new MultiMailsender(); 
      sms.sendTextMail(mailInfo);//发送文体格式 
      MultiMailsender.sendHtmlMail(mailInfo);//发送html格式 
      MultiMailsender.sendMailtoMultiCC(mailInfo);//发送抄送
}      
}
